import axios from 'axios';
import store from '../store';

export function getUser(){
    return axios.get('/getUser')
    .then(function(response){
        store.dispatch({
            type: 'USER_NAME',
            name: response.data.user.name
        });

        store.dispatch({
            type: 'USER_ACCOUNT',
            acount: response.data.user.tel
        });

        store.dispatch({
            type: 'USER_PASSWORD',
            password: response.data.user.pw
        });
    })
    .catch(function(err){
        console.log(err)
    })
}